<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //打印1-100以内的奇数和
        var l=0;
        for(var a=1;a<=100;a++){
            if(a%2==1){
               //console.log(a);
             l+=a;
               
            }
        }
        console.log(l); 















var l=0;
        for(var a=1;a<=100;a++){
            if(a%2==1){
                l+=a
            }
        } 
        console.log(l);








var l=0
        for(var a=0;a<=100;a++){
            if(a%2==0){
                l+=a
            }
        }
        console.log(l);
    </script>
</body>
</html>